package member.json;

import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import member.vo.MemberVO;

import org.json.JSONObject;
import org.springframework.web.servlet.view.AbstractView;

public class SerachPass extends AbstractView {

	@SuppressWarnings("rawtypes")
	@Override
	protected void renderMergedOutputModel(Map map,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		Set set = map.keySet();
		Iterator itr=set.iterator();
		MemberVO dto=(MemberVO)map.get(itr.next());
		JSONObject obj = new JSONObject();
		if(dto.getMemScrtNo()==null){
			obj.put("message", "입력된 검색결과로 값을 찾을 수 없습니다.");
		}else{
			obj.put("message",dto.getMemScrtNo());
		}
		response.setContentType("text/html;charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		PrintWriter out = response.getWriter();
		out.println(obj.toString());
		out.close();
	}

}
